/*************************************************************
 * File: Parameter.java
 * Copyright (c) 2012
 * Author: Huang Shaobin
 * Email: Shaobin.Software@gmail.com Shaobin_Software@163.com 
 * Date: Mar 8, 2013
 * Description: 
 ************************************************************/

package snow.biz.system.model;

import org.apache.commons.lang.StringUtils;

import snow.biz.basic.model.Persistence;
import snow.core.enums.Status;
import snow.core.exceptions.BusinessException;
import snow.core.toolkit.Validator;

/**
 * 配置参数
 * 
 * @author Shaobin.Software@gmail.com Shaobin_Software@163.com
 * @version 1.0
 */
@SuppressWarnings("serial")
public class Parameter extends Persistence<Integer> {

	private String name; // 参数名称
	private String type; // 参数类型
	private String value; // 参数值
	private String comment; // 参数描述

	protected Parameter() {
	}

	public Parameter(User createUser, Status status, String name, String type, String value, String comment) throws BusinessException {
		super(createUser, status);
		setName(name);
		setType(type);
		setValue(value);
		setComment(comment);
	}

	public String getComment() {
		return this.comment;
	}

	public String getName() {
		return this.name;
	}

	public String getType() {
		return this.type;
	}

	public String getValue() {
		return this.value;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public void setName(String name) throws BusinessException {
		Validator.notBlank(name, "200121", "failure.system.parameter.name.not.blank");
		this.name = StringUtils.trim(name);
	}

	public void setType(String type) throws BusinessException {
		Validator.notBlank(type, "200122", "failure.system.parameter.type.not.blank");
		this.type = StringUtils.trim(type);
	}

	public void setValue(String value) {
		this.value = value;
	}

}
